unit MLPARunReport;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RpCon, RpConDS, RpBase, RpSystem, RpDefine, RpRave, DB, DBClient;

type
  TfrmRunReport = class(TForm)
    RvProject: TRvProject;
    RvSystem: TRvSystem;
    cdsSamples: TClientDataSet;
    cdsSamplesLabId: TStringField;
    cdsSampleskitid: TStringField;
    cdsSamplesSampleIDField: TStringField;
    cdsSamplesPlateWell: TStringField;
    cdsSamplesComment: TStringField;
    rdscSamples: TRvDataSetConnection;
  private
    { Private declarations }
  public
    { Public declarations }
    procedure DoDialog;
  end;

var
  frmRunReport: TfrmRunReport;

implementation

uses MLPAdm;

{$R *.dfm}

{ TForm1 }

procedure TfrmRunReport.DoDialog;
begin
  RvProject.Close;

  //Show;
  dm.qrySamplesheet.Active:=False;
  dm.qrySamplesheet.Parameters[0].Value:=dm.tblRunsrunid.Value;
  dm.qrySamplesheet.Active:=True;
  cdsSamples.Active:=false;
  cdsSamples.CreateDataSet;
  //
  while not dm.qrySamplesheet.Eof do
  begin
    cdsSamples.AppendRecord([DM.qrySamplesheet.Fields[0].Value,DM.qrySamplesheet.Fields[1].Value,DM.qrySamplesheet.Fields[2].Value,DM.qrySamplesheet.Fields[3].Value,DM.qrySamplesheet.Fields[4].Value]);
    dm.qrySamplesheet.Next;
  end;
  dm.qrySamplesheet.Close;
  // cdsSamples.SaveToFile('testdata.xml',dfXML);

  RvProject.Open;
  RvProject.SetParam('mlpaDate',dm.tblRunsDate.AsString);
  RvProject.SetParam('mlpaTechnician',dm.tblRunsTechnician.Value);
  RvProject.SetParam('mlpaRunName',dm.tblRunsGelfileName.Value);
  if RvProject.SelectReport('Samplesheet',false) then
    RvProject.Execute;
  RvProject.Close;
  //Hide;
end;

end.
